﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using NUnit.Framework;

using Spring.Context;
using Spring.Context.Support;
using Spring.Util;

using efish.Framework.Service;
using efish.Framework.Model;

namespace efish.IntegrationTest.Service
{
    [TestFixture]
    public class TestNewsService
    {
        private IApplicationContext ctx;
        private INewsService s;

        [SetUp]
        public void SetUp()
        {
            ctx = ContextRegistry.GetContext();
            s = ctx["NewsService"] as INewsService;
        }

        [Test]
        public void TestGetNews()
        {
            IList<NewsItem> news = s.GetNewss();

            //assertions....
            Console.WriteLine("INFO\tThe count of users is {0}", news.Count);

            foreach (NewsItem item in news)
            {
                Console.WriteLine("INFO\t{0}\t{1}", item.ID, item.Title);
            }
        }

    }
}

